package com.paper.tiger.easy.rpc.s.server;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * [简要描述]:
 * [详细描述]:
 *
 * @author ZouHaiBo
 * @version 1.0, 2021/6/28 19:52
 * @since JDK 1.8
 */
@Aspect
@Component
public class TestAop
{


    /**
     * [简要描述]:定义一个annotation切入点<br/>
     * [详细描述]:切入点<br/>
     * llxiao  2018/9/2 - 17:02
     **/
    @Pointcut("@within(com.paper.tiger.easy.rpc.s.server.Test) || @annotation(com.paper.tiger.easy.rpc.s.server.Test)")
    public void logAnnotation()
    {

    }

    // around 切面强化
    @Around("logAnnotation()")
    public Object execute(ProceedingJoinPoint joinPoint) throws Throwable
    {
        System.out.println("开始执行");
        Object proceed = joinPoint.proceed();
        System.out.println("结束执行");

        return proceed;
    }


}
